<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div class="pagination">
	<ul>
		<c:if test="${pageView.currentPage > 1}">
			<li><a href="javascript:turnPage(1);">首页</a></li>
			<li><a href="javascript:turnPage(${pageView.currentPage - 1});" title="上一页" class="sprite prev">上一页</a></li>
		</c:if>
		<c:if test="${pageView.pageIndex.startIndex > 1}">
			<li class="disabled"><a href="#">...</a></li>
		</c:if>
		<c:if test="${pageView.totalPage != 0}">
			<c:forEach var="index" begin="${pageView.pageIndex.startIndex}" end="${pageView.pageIndex.endIndex}" step="1">     
			     <c:choose>
				   <c:when test="${pageView.currentPage == index}">
				   		<li class="disabled"><a href="javascript:void(0);">&nbsp;${index}&nbsp;</a></li>
				   </c:when>
				   <c:otherwise>
						<li><a href="javascript:turnPage(${index});">${index}</a></li>
				   </c:otherwise>
				</c:choose>
			</c:forEach>  
		</c:if>
		<c:if test="${pageView.totalPage > pageView.pageIndex.endIndex}">
			<li class="disabled"><a href="#">...</a></li> 
		</c:if>
		<c:if test="${pageView.currentPage < pageView.totalPage}">
			<li><a href="javascript:turnPage(${pageView.currentPage+1});" title="下一页">下一页</a></li> 
			<li><a href="javascript:turnPage(${pageView.totalPage});" class="end">尾页</a></li>
		</c:if>
	</ul>
	<ul style="margin-left:45px;">
		<li>
			<a>
				共${pageView.totalPage}页，总计<strong>${pageView.totalRecord}</strong> 条记录
			</a>
		</li>
	</ul>
</div>
<script type="text/javascript">
/**
 * 页面跳转
 */
function gotoPage(gotoPageNo,totalPage)
{
	var pageNo = parseInt($.trim($(gotoPageNo).val()));
	if(pageNo!="" && pageNo <= totalPage && 0 < pageNo)
	{
		turnPage(pageNo);
	}
	else
	{
		$(gotoPageNo).val("");
	}
}
</script>